Skip to content

[MRG] Remove openmp implementation for emd2 #820

Merged
rflamary merged 3 commits into
PythonOT:masterfrom
nathanneike:remove-simplex-openmp
Jun 16, 2026
Merged

[MRG] Remove openmp implementation for emd2 #820
rflamary merged 3 commits into
PythonOT:masterfrom
nathanneike:remove-simplex-openmp

Conversation

@nathanneike

@nathanneike nathanneike commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Types of changes

  • Code cleanup / simplification
  • API compatibility maintenance
  • Tests updated

Motivation and context / Related issue

Remove the OpenMP-specific network simplex implementation because it did not provide meaningful runtime
gains, while keeping numThreads as a compatibility parameter.

How has this been tested (if it applies)

Updated the existing EMD/EMD2 test coverage to check that numThreads remains accepted as a no-op
compatibility parameter.

PR checklist

  • I have read the CONTRIBUTING document.
  • The documentation is up-to-date with the changes I made (check build artifacts).
  • All tests passed, and additional code has been covered with new tests.
  • I have added the PR and Issue fix to the RELEASES.md file.

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.79%. Comparing base (aed0120) to head (5cce547).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #820      +/-   ##
==========================================
- Coverage   96.81%   96.79%   -0.02%     
==========================================
  Files         124      124              
  Lines       24263    24276      +13     
==========================================
+ Hits        23490    23498       +8     
- Misses        773      778       +5     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rflamary rflamary changed the title removed openmp implementation for the simplex algorithm since no real… [WIP] Remove openmp implementation for emd2 Jun 11, 2026

@rflamary rflamary left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nathanneike

a few comments below about a warning to telle user about deprecation

Comment thread ot/lp/_network_simplex.py
"max" selects the highest number possible.
numThreads: int or "max", optional (default=1)
Deprecated compatibility parameter. The network simplex solver no
longer uses OpenMP, so this parameter is ignored.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a test and a warning in the function to nstate that numThreads is deprecated if not given the default value. do that for both emd and emd2 please

Comment thread test/test_ot.py

def test_omp_emd2():
# test emd2 and emd2 with openmp for simple identity
def test_emd2_num_threads_compatibility():

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and check that a warning is raised

@rflamary rflamary mentioned this pull request Jun 15, 2026
6 tasks
@rflamary rflamary changed the title [WIP] Remove openmp implementation for emd2 [MRG] Remove openmp implementation for emd2 Jun 16, 2026
@rflamary rflamary merged commit 3e10dd6 into PythonOT:master Jun 16, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants